home *** CD-ROM | disk | FTP | other *** search
- ########################################################################
- # Module : hamster.hsm
- # Description: Functions related with Hamster.
- # Maintainer : Juergen Haible <juergen.haible@t-online.de>
- # Version : 2000-05-07
- ########################################################################
- # NOTE:
- # This module is delivered with Hamster and it will be overwritten when
- # installing a new version of it. It might also be used by accompanying
- # demo-scripts, which depend on the current implementation.
- # So do NOT change this file unless you REALLY know what you do!
- ########################################################################
-
- #!initialize
-
- debug( 255, "<<< module 'hamster.hsm' >>>" )
-
- # HamMessage()-messages:
- varset( $HAM_MSG_HAMSTER_EXIT , 1 )
- varset( $HAM_MSG_RESET_COUNTERS , 2 )
- varset( $HAM_MSG_LOCALNNTP_ONOFF , 3 )
- varset( $HAM_MSG_LOCALPOP3_ONOFF , 4 )
- varset( $HAM_MSG_LOCALSMTP_ONOFF , 5 )
- varset( $HAM_MSG_SHOWWINDOW , 6 )
- varset( $HAM_MSG_SHOWICON , 7 )
- varset( $HAM_MSG_STOPALLTASKS , 8 )
-
- # HamPurge()-options:
- varset( $HAM_PURGEOPT_DOALL , 0xFF )
- varset( $HAM_PURGEOPT_DONEWS , 0x01 )
- varset( $HAM_PURGEOPT_DOHISTORY , 0x02 )
- varset( $HAM_PURGEOPT_DOKILLS , 0x04 )
- varset( $HAM_PURGEOPT_DOMHISTORY , 0x08 )
-
- return( 0 )
-
- ########################################################################
- # HamRequireVersion: Check, if Hamster is new enough to run the script
- ########################################################################
- # [IN] $ReqVersion: string with required version
- # $ErrorStop : True: stop script; False: just return result
- # [OUT] (result) : True: version ok, False: version too old
- # Example: HamRequireVersion( "1.3.18.0", True )
-
- sub HamRequireVersion( $ReqVersion, $ErrorStop )
- var( $r, $r1, $r2, $r3, $r4, $h, $h1, $h2, $h3, $h4 )
-
- RE_Split( $ReqVersion, "\.", $r1, $r2, $r3, $r4 )
- RE_Split( HamVersion, "\.", $h1, $h2, $h3, $h4 )
-
- $r = str($r1,3) + str($r2,3) + str($r3,3) + str($r4,3)
- $h = str($h1,3) + str($h2,3) + str($h3,3) + str($h4,3)
-
- if( $r <= $h )
- return( True ) # version ok
- else
- if( $ErrorStop )
- $r = "This script requires Hamster Vr. " + $ReqVersion + " or later!"
- msgbox( $r, "Version-Check", 0x10 )
- error( $r )
- endif
- return( False ) # version too old
- endif
-
- endsub
-